﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Sector7.Restaurant.CoreType.Entity
{
    /// <summary>
    /// 桌位状态信息
    /// </summary>
    public class TableStatusInfor : INotifyPropertyChanged
    {
        private int _total;
        private int _idle;
        private int _used;
        private int _reserved;
        private int _disabled;

        /// <summary>
        /// 获取或设置桌位总共数量
        /// </summary>
        public int Total
        {
            get { return _total; }
            set
            {
                if (_total != value)
                {
                    _total = value;
                    OnPropertyChanged("Total");
                }
            }
        }

        /// <summary>
        /// 获取或设置空闲桌位数量
        /// </summary>
        public int Idle
        {
            get { return _idle; }
            set
            {
                if (_idle != value)
                {
                    _idle = value;
                    OnPropertyChanged("Idle");
                }
            }
        }

        /// <summary>
        /// 获取或设置使用桌位数量
        /// </summary>
        public int Used
        {
            get { return _used; }
            set
            {
                if (_used != value)
                {
                    _used = value;
                    OnPropertyChanged("Used");
                }
            }
        }

        /// <summary>
        /// 获取或设置预定桌位数量
        /// </summary>
        public int Reserved
        {
            get { return _reserved; }
            set
            {
                if (_reserved != value)
                {
                    _reserved = value;
                    OnPropertyChanged("Reserved");
                }
            }
        }

        /// <summary>
        /// 获取或设置停用桌位数量
        /// </summary>
        public int Disabled
        {
            get { return _disabled; }
            set
            {
                if (_disabled != value)
                {
                    _disabled = value;
                    OnPropertyChanged("Disabled");
                }
            }
        }

        /// <summary>
        /// 属性改变事件
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged = null;

        /// <summary>
        /// 触发属性改变事件
        /// </summary>
        /// <param name="propertyName"></param>
        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
